package com.otaliastudios.cameraview.livedata

import androidx.annotation.MainThread
import androidx.lifecycle.MutableLiveData
import com.otaliastudios.cameraview.entity.WarterMarkBean
import java.util.concurrent.ConcurrentHashMap


class MarkMapLiveData(val value: ConcurrentHashMap<String, WarterMarkBean>) :
    MutableLiveData<ConcurrentHashMap<String, WarterMarkBean>>(value) {

    companion object {
        private lateinit var sInstance: MarkMapLiveData

        @MainThread
        fun get(): MarkMapLiveData {
            sInstance = if (Companion::sInstance.isInitialized) sInstance else MarkMapLiveData(
                ConcurrentHashMap<String, WarterMarkBean>()
            )
            return sInstance
        }
    }

}